// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

package mpls_qos;


//
// This file is part of an OMNeT++/OMNEST simulation example.
//
// Copyright (C) 2003-2008 Andras Varga
//
// This file is distributed WITHOUT ANY WARRANTY. See the file
// `license' for details on this and other legal matters.
//


simple Ingress_Router
{
    parameters:
        @display("i=block/routing");
    gates:
        inout gate[];

}

simple Ergress_Router
{
    parameters:
        @display("i=block/routing");
    gates:
        inout gate[];

}

simple Core_Router
{
    parameters:
        @display("i=block/routing");
    gates:
        inout gate[];

}

//
// Same as Tictoc8.
//
network MPLS_QOS
{
    @display("bgb=843,366");
    types:
        channel Channel extends ned.DelayChannel
        {
            delay = 100ms;
        }


    submodules:
        IR1[1]: Ingress_Router {
            @display("p=71,93;is=n;i=old/srouter,gold");
        }
        IR2[1]: Ingress_Router {
            @display("p=73,146;is=n;i=old/srouter,gold");
        }
        IR3[1]: Ingress_Router {
            @display("p=75,211;is=n;i=old/srouter,gold");
        }
        ER[1]: Ergress_Router {
            parameters:
                @display("i=block/join,gold;p=795,179");
        }

        CR4[1]: Core_Router {

            @display("p=200,80,c,50;i=abstract/router");
        }
        CR5[1]: Core_Router {

            @display("p=200,130;i=abstract/router");
        }
        CR6[1]: Core_Router {

            @display("p=200,180;i=abstract/router");
        }
        CR7[1]: Core_Router {

            @display("p=200,230;i=abstract/router");
        }
        CR8[1]: Core_Router {

            @display("p=400,80;i=abstract/router");
        }
        CR9[1]: Core_Router {

            @display("p=400,130;i=abstract/router");
        }
        CR10[1]: Core_Router {

            @display("p=400,180;i=abstract/router");
        }
        CR11[1]: Core_Router {

            @display("p=400,230;i=abstract/router");
        }
        CR12[1]: Core_Router {

            @display("p=600,80;i=abstract/router");
        }
        CR13[1]: Core_Router {

            @display("p=600,230;i=abstract/router");
        }

    connections:
        IR1[0].gate++ <--> Channel <--> CR4[0].gate++;
        IR1[0].gate++ <--> Channel <--> CR5[0].gate++;
        IR2[0].gate++ <--> Channel <--> CR5[0].gate++;
        IR2[0].gate++ <--> Channel <--> CR6[0].gate++;
        IR3[0].gate++ <--> Channel <--> CR6[0].gate++;
        IR3[0].gate++ <--> Channel <--> CR7[0].gate++;

        CR4[0].gate++ <--> Channel <--> CR8[0].gate++;
        CR5[0].gate++ <--> Channel <--> CR8[0].gate++;
        CR5[0].gate++ <--> Channel <--> CR9[0].gate++;
        CR6[0].gate++ <--> Channel <--> CR9[0].gate++;
        CR6[0].gate++ <--> Channel <--> CR10[0].gate++;
        CR7[0].gate++ <--> Channel <--> CR10[0].gate++;
        CR7[0].gate++ <--> Channel <--> CR11[0].gate++;

        CR8[0].gate++ <--> Channel <--> CR12[0].gate++;
        CR9[0].gate++ <--> Channel <--> CR12[0].gate++;
        CR10[0].gate++ <--> Channel <--> CR13[0].gate++;
        CR11[0].gate++ <--> Channel <--> CR13[0].gate++;

        CR12[0].gate++ <--> Channel <--> ER[0].gate++;
        CR9[0].gate++ <--> Channel <--> ER[0].gate++;
        CR10[0].gate++ <--> Channel <--> ER[0].gate++;
        CR13[0].gate++ <--> Channel <--> ER[0].gate++;

}